#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void swap_value1(char **str1, char **str2)
{
    char *temp = *str1;
    *str1 = *str2;
    *str2 = temp;
}

void swap_value2(int *x, int *y)
{
    int temp = *x;
    *x = *y;
    *y = temp;
}

void swap_value3(int **x, int **y)
{

    int temp = **x;
    **x = **y;
    **y = temp;
}

int main(int argc, char const *argv[])
{
#if 0
    char *str1 = "Zhang";
    char *str2 = "Yong";
    swap_value1(&str1, &str2);
    printf("%s %s", str1, str2);
#endif

#if 0
    int x = 100, y = 200;
    swap_value2(&x, &y);
    printf("x=%p,y=%p\n", &x, &y);
#endif

#if 0
    int x = 100, y = 200;
    int *p_x = &x;
    int *p_y = &y;
    printf("%d %d\n", x, y);
    printf("value_x=%p,value_y=%p\n", p_x, p_y);
    swap_value3(&p_x, &p_y);
    printf("value_x=%d,value_y=%d\n", x, y);
    printf("value_x=%p,value_y=%p\n", p_x, p_y);
#endif
    
    return 0;
}
